home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
YERK
/
SUPPLEME
/
UNSUPPOR
/
OPTIONAL
/
2DARRAY
< prev
next >
Wrap
Text File
|
1986-01-22
|
946b
|
48 lines
\ 2 Dimensional Array
\ 3/01/85 rw
\ 1/07/86 cdn Added print: method
:CLASS 2dArray <Super Array 4 <Indexed
Int xbound
\ ( xbound -- ) Store x bound; y bound already used by super Array
:M CLASSINIT: put: xbound ;M
\ ( -- ) Allocate arrays for second dimension
:M NEW:
limit: super 0
DO
get: xbound heap> array i to: super
LOOP
;M
\ ( val x y -- )
:M TO: to: [ at: super ] ;M
\ ( x y -- )
:M AT: at: [ at: super ] ;M
\ ( -- ) Deallocate array space in heap
:M DISPOSE:
limit: super 0
DO
i at: super killptr
LOOP
;M
:M XLIMIT: get: xbound ;M
:M YLIMIT: limit: super ;M
:M PRINT: ylimit: self 0
DO CR
xlimit: self 0
DO
i j at: self .
LOOP
LOOP
;M
;CLASS